import pymongo


#启动mongodb服务
#e:\mongodb\bin\mongod --dbpath e:\mongodb\data\db
myclient = pymongo.MongoClient("mongodb://localhost:27017/")

dblist = myclient.list_database_names()
#dblist = myclient.database_names()
if "runoobdb" in dblist:
    print("数据库已经存在")
